Skip to content

Fix issue: #963 UI Overflow on Mobile for Home page#1030

Merged
arkid15r merged 11 commits intoOWASP:mainfrom
KaranNegi20Feb:fixing-home-overflow
Mar 11, 2025
Merged

Fix issue: #963 UI Overflow on Mobile for Home page#1030
arkid15r merged 11 commits intoOWASP:mainfrom
KaranNegi20Feb:fixing-home-overflow

Conversation

@KaranNegi20Feb
Copy link
Contributor

Describe the bug:
The page width and the container width do not match properly, causing horizontal overflow on mobile devices.

Fix results:
Screenshot 2025-03-07 at 12 17 35 AM

Fix_mobile.mov

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2025

Summary by CodeRabbit

  • Refactor

    • Enhanced the homepage layout with improved spacing, updated background styling, and refined grid displays. Upcoming events now appear in a three-column layout, while new chapters and projects are organized into two columns.
    • Adjusted the contributor showcase for a more focused presentation.
  • New Features

    • Added a new section inviting users to join OWASP.

Walkthrough

The pull request refactors the Home page component. The changes include updates to the layout and styling, such as adding extra padding and a new background color to the outer container. The MultiSearchBar component now has a reordered prop list with the removal of the eventData prop. Grid layouts have been adjusted for Upcoming Events (now three columns) and for the New Chapters and New Projects sections (now two columns). Moreover, the TopContributors component now displays six contributors instead of nine, and a new section inviting users to join OWASP has been added.

Changes

File Path Change Summary
frontend/src/.../Home.tsx - Modified outer <div>: added padding and new background color.
- Reordered props in MultiSearchBar and removed the eventData prop.
- Updated grid layouts: Upcoming Events now uses three columns; New Chapters and New Projects use a two-column grid.
- Adjusted TopContributors to display 6 entries.
- Added a join OWASP section.

Suggested Reviewers

  • kasya
  • arkid15r
  • aramattamara

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94e45fc and 9a8944b.

📒 Files selected for processing (1)
  • frontend/src/pages/Home.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/pages/Home.tsx
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: Run frontend unit tests
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run backend tests

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
frontend/src/pages/Home.tsx (1)

10-19: ⚠️ Potential issue

Remove unused import EventType.

The EventType import on line 18 is declared but never used in this file, as flagged by ESLint in the pipeline failure.

- import { EventType } from 'types/event'
🧰 Tools
🪛 GitHub Actions: Run CI/CD

[error] 10-10: 'EventType' is defined but never used @typescript-eslint/no-unused-vars

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0033a44 and 418b1d3.

📒 Files selected for processing (1)
  • frontend/src/pages/Home.tsx (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Run CI/CD
frontend/src/pages/Home.tsx

[error] 10-10: 'EventType' is defined but never used @typescript-eslint/no-unused-vars

🔇 Additional comments (5)
frontend/src/pages/Home.tsx (5)

111-113: Good container restructuring to fix mobile overflow.

The changes to the container structure address the mobile overflow issue effectively. Moving from a fixed-width outer container to a padded container with a max-width inner wrapper is a good responsive design approach.


131-183: Good restructuring of chapter and project cards.

The implementation of separate cards for new chapters and projects with appropriate formatting and consistent styling improves the layout organization and readability on mobile devices.


184-184: Appropriate reduction in displayed contributors.

Reducing the maxInitialDisplay from 9 to 6 for TopContributors is a good adjustment that will help prevent overcrowding on mobile screens.


192-221: Good enhancement with conditional comment count display.

The added conditional rendering for comment counts in the ItemCardList components is a nice improvement that prevents displaying empty or zero counts.


223-249: Good responsive grid layout for statistics.

Using a responsive grid that switches from 1 column on mobile to 4 columns on medium screens ensures the statistics display properly on all device sizes.

@KaranNegi20Feb KaranNegi20Feb force-pushed the fixing-home-overflow branch 2 times, most recently from 88066b1 to 2a34af3 Compare March 6, 2025 19:52
@KaranNegi20Feb KaranNegi20Feb marked this pull request as draft March 6, 2025 19:58
@KaranNegi20Feb KaranNegi20Feb marked this pull request as ready for review March 6, 2025 20:33
@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r and @kasya can you please review the PR. Thank you.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issue is this PR related to?

@KaranNegi20Feb
Copy link
Contributor Author

What issue is this PR related to?
#963

@arkid15r arkid15r linked an issue Mar 7, 2025 that may be closed by this pull request
@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r all the merge conflicts are resolved, you can now proceed with your review. Thank you.

@KaranNegi20Feb KaranNegi20Feb requested a review from arkid15r March 7, 2025 03:55
Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating mobile view! I like that!

But I noticed a few issues that need to be addressed ⬇️

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
frontend/src/pages/Home.tsx (1)

113-113: Consider more responsive padding for the main container.

The padding of p-8 (32px) might be excessive on very small mobile screens. Using responsive padding would provide better spacing across different device sizes.

- <div className="mt-16 min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300">
+ <div className="mt-16 min-h-screen p-4 md:p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300">
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 886e785 and 9d5f492.

📒 Files selected for processing (2)
  • frontend/__tests__/e2e/pages/Contribute.spec.ts (1 hunks)
  • frontend/src/pages/Home.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/tests/e2e/pages/Contribute.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend e2e tests
🔇 Additional comments (5)
frontend/src/pages/Home.tsx (5)

114-114: LGTM! Great solution for preventing overflow.

Adding a centered, max-width container is an excellent approach to address the mobile overflow issue. This ensures content is properly constrained across all device sizes.


160-212: Good implementation of responsive grid.

The two-column layout with md:grid-cols-2 properly collapses to a single column on mobile screens, preventing horizontal overflow. The consistent use of this pattern throughout the page is excellent for maintaining responsive behavior.


213-213: Reduced the initial contributors display count.

The maxInitialDisplay prop for TopContributors has been reduced from 9 to 6, which should help with mobile display by showing fewer items initially.


251-260: Good responsive implementation for counter stats.

The grid layout with md:grid-cols-4 ensures the counter stats are stacked vertically on mobile screens and displayed in a row on larger screens, which is appropriate for mobile viewing.


277-279: Moving logos implementation preserved as requested.

As noted in the past review comments, the MovingLogos component has been correctly preserved and properly integrated into the new layout structure.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r i have made the required changes, you may go through those and review it. Thank you 😁.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r i have made the required changes, you may go through those and review it. Thank you 😁.

Hey @arkid15r and @kasya could you please review the pr. Thank you ☺️.

aramattamara
aramattamara previously approved these changes Mar 9, 2025
Copy link
Contributor

@aramattamara aramattamara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on local envirnment, looks good! Thanks for this PR!

@KaranNegi20Feb
Copy link
Contributor Author

Tested on local envirnment, looks good! Thanks for this PR!

welcome @aramattamara 😄.

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there are still some changes to the home page that are not rellevant to this task.

  • We used to have 3 columns for Upcoming events, now it shows two:
    Screenshot 2025-03-08 at 6 08 38 PM

  • Recent issues and releases are still showing up in rows instead of having two columns side by side:
    Screenshot 2025-03-08 at 6 09 54 PM
    Screenshot 2025-03-08 at 6 12 39 PM

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya I checked the code push, everything seems fine here, the branch runs fine on my device as well, if you could show me what's that you saw that does not match the right version. Thank you.

@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 10, 2025

This is how it looks on my local machine.

Screen.Recording.2025-03-10.at.10.24.35.AM.mov

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep truncate class for long titles.

@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 11, 2025

Please keep truncate class for long titles.

Truncated the long titles:

mobile.overflow.1.mov

Hey @arkid15r i have made the required changes you may now go through the PR to review it. Thank you.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r you can now review the changes, also fixed the merge conflicts, Thank you.

@sonarqubecloud
Copy link

@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r I have made also covered the merge conflicts, please review the PR. Thank you.

@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 11, 2025

The results of the PR:

Screen.Recording.2025-03-12.at.2.23.23.AM.mov
Screen.Recording.2025-03-12.at.2.23.43.AM.mov

@arkid15r arkid15r enabled auto-merge March 11, 2025 22:04
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@arkid15r arkid15r dismissed kasya’s stale review March 11, 2025 22:05

I checked it locally and it looks fine.

@arkid15r arkid15r added this pull request to the merge queue Mar 11, 2025
Merged via the queue into OWASP:main with commit 6e690e2 Mar 11, 2025
18 checks passed
shdwcodr pushed a commit to shdwcodr/Nest that referenced this pull request Jun 5, 2025
* fixing issues merge-conflicts and tests

* Fix: home page issue and errors

* Fix: home page issue and fixing ci/cd error

* changes made to reviews

* fixing the reviews 10March

* fixing the reviews 10March

* added truncate to recent events

* new resolved merge conflicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Overflow on Mobile (Chrome)

4 participants

Comments